17. 练习:GROUP BY(第二部分)
问题:GROUP BY(第二部分)
根据以下 SQL 表格信息回答以下问题。如果你遇到问题或想要对比检查你的答案,可以在下一页面的顶部找到我的答案。
-
对于每个客户,确定他们在订单中购买的每种纸张的平均数额。结果应该有四列:客户 名称 一列,每种纸张类型的平均数额一列。
-
对于每个客户,确定在每个订单中针对每个纸张类型的平均消费数额。结果应该有四列:客户 名称 一列,每种纸张类型的平均消费数额一列。
-
确定在 web_events 表格中每个 销售代表 使用特定 渠道 的次数。最终表格应该有三列: 销售代表的名称 、 渠道 和发生次数。按照最高的发生次数在最上面对表格排序。
-
确定在 web_events 表格中针对每个 地区 特定 渠道 的使用次数。最终表格应该有三列: 区域名称 、 渠道 和发生次数。按照最高的发生次数在最上面对表格排序。
Workspace
This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity , so you may be able to download them there.
Workspace Information:
- Default file path:
- Workspace type: sql-evaluator
- Opened files (when workspace is loaded): n/a